"""
添加日志按钮类
"""
from pages.base_page import BasePage
from selenium.webdriver.common.by import By


class AddLogPage(BasePage):
    add_log_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div:nth-child(2) > div > a")
    # 日志错误信息提示
    log_mistake_tips_locator=(By.CSS_SELECTOR,"body > div.container > div.alert.alert-error")

    def click_add_log(self):
        """点击新建日志"""
        self.driver.find_element(*self.add_log_locator).click()

    def log_mistake(self):
        """日志错误信息提示"""
        return self.driver.find_element(*self.log_mistake_tips_locator).text